# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
#
# Examples:
#
#   movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
#   Character.create(name: 'Luke', movie: movies.first)

singers = Singer.create([
  {name: 'Kenton Wang',sex:'male',height:186, pic:'http://www.qq.com/'},
  {name: 'Shen Wang', sex:'female',height:166, pic:'http://www.qq.com/'},
  {name: 'Guoyi Si', sex:'male',height:168, pic:'http://www.qq.com/'},
  {name: 'KinKing100 Wang',sex:'female', height:156, pic:'http://www.qq.com/'}
])
albums = Album.create([
  {name: 'album1', publishtime: DateTime.now.ago(1.year)},
  {name: 'album2', publishtime: DateTime.now.ago(2.year)},
  {name: 'album3', publishtime: DateTime.now.ago(3.year)},
  {name: 'album4', publishtime: DateTime.now.ago(1.year)},
])



Music.create(title: 'music1', length:'61',album_id:'1', url:'http://www.baidu.com').singers << Singer.find(1)
Music.create(title: 'music2', length:'21',album_id:'2', url:'http://www.baidu.com').singers << Singer.find(2)
Music.create(title: 'music3', length:'31',album_id:'3', url:'http://www.baidu.com').singers << Singer.find(3)
Music.create(title: 'music4', length:'161',album_id:'1', url:'http://www.baidu.com').singers << Singer.find(4)
Music.create(title: 'music5', length:'261',album_id:'1', url:'http://www.baidu.com').singers << Singer.find(2)
Music.create(title: 'music6', length:'31',album_id:'0', url:'http://www.baidu.com').singers << Singer.find(2)
Music.create(title: 'music7', length:'21',album_id:'2', url:'http://www.baidu.com').singers << Singer.find(1)
Music.create(title: 'music8', length:'22',album_id:'3', url:'http://www.baidu.com').singers << Singer.find(3)
Music.create(title: 'music9', length:'64',album_id:'3', url:'http://www.baidu.com').singers << Singer.find(1)
Music.create(title: 'music10', length:'65',album_id:'2', url:'http://www.baidu.com').singers << Singer.find(2)
Music.create(title: 'music11', length:'67',album_id:'3', url:'http://www.baidu.com').singers << Singer.find(2)
